<template>
    <div class="mui-numbox" data-numbox-min='1' style="height: 25px;">
        <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
        <input type="number" :value="initcount" class="mui-input-numbox" @change='countChanged' ref='numbox' readonly/>
        <button type="button" class="mui-btn mui-btn-numbox-plus">+</button>
    </div>
</template>
<script>
import mui from '../../lib/mui/js/mui.min.js'
export default {
    name: "",
    mounted() {
        //do something after mounting vue instance
        mui(".mui-numbox").numbox();
    },
    methods: {
        countChanged() {
            this.$store.commit('updateGoodsInfo',{
                id: this.goodsid,
                count: this.$refs.numbox.value
            })
        }
    },
    props: ['initcount','goodsid'],
}
</script>
<style lang="scss" scoped>
</style>
